<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="shortcut icon" href="favicon.ico"> <link href="/css/bootstrap.min.css?v=3.3.5" rel="stylesheet">
    <link href="/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="/css/animate.min.css" rel="stylesheet">
    <meta http-equiv="Cache-control" content="no-cache">
	<meta http-equiv="Cache" content="no-cache">
    <link href="/css/style.min.css?v=4.0.0" rel="stylesheet"><base target="_blank">
    <link href="/css/bootstrap.min.css" rel="stylesheet">
    <link href="/css/bootstrap-treeview.css" rel="stylesheet">
	<!-- 搜索样式CSS-Start -->
	<link href="/common/css/searchStyle.css" rel="stylesheet">
	<!-- 搜索样式CSS-End -->
	<!-- 下拉 -->
	<link href="/css/plugins/chosen/chosen.css" rel="stylesheet">
</head>

<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-6">
                <div class="ibox float-e-margins">
                    <div class="ibox-content">
                        <form class="form-horizontal m-t" id="signupForm">
                           <div class="form-group">
                                <label class="col-sm-3 control-label">公司名称：</label>
                                <div class="col-sm-8">
                                <input name="id" type="hidden">
                                    <input id="name" name="name" class="form-control" type="text" aria-required="true" aria-invalid="true">
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-sm-8 col-sm-offset-8">
                                    <button class="btn btn-primary" type="submit">提交</button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script src="/js/jquery.min.js?v=2.1.4"></script>
    <script src="/js/bootstrap.min.js?v=3.3.5"></script>
    <script src="/js/content.min.js?v=1.0.0"></script>
    <script src="/js/plugins/validate/jquery.validate.min.js"></script>
    <script src="/js/plugins/validate/messages_zh.min.js"></script>
    <script src="/js/plugins/layer-pc/layer.js"></script>
    <script src="/common/form-validator.js"></script>
    <script src="/common/petecat.js"></script>
    <script src="/common/bootstrap-treeview.js"></script>
    <script src="/js/jquery.cookie.js"></script>
    <!-- HTML之间的传值 -->
	<script src="/js/jquery.params.js"></script>
    <!-- 组件通用 -->
    <script src="/common/frame.js"></script>
    <!-- 下拉 -->
	<script src="/js/plugins/chosen/chosen.jquery.js"></script>
	<script type="text/javascript">
		$(function(){
			var e = "<i class='fa fa-times-circle'></i> ";
		    $("#signupForm").validate({
		    	rules: {
		    		name: {
	                    required: !0,
	                    minlength: 2
	                }
	            },
	            messages: {
	                name: {
	                    required: e + "请输入公司名称",
	                    minlength: e + "公司名称必须两个字符以上"
	                }
	            },
		        submitHandler:function(form){
		            var data = serializeForm(form);
		        	var formData = JSON.stringify(data);
		        	var req = {};
		        	req['reqJSON'] = {
	        			type : 'put',
	        			url : SSO_URL+'/system/company/modifyCompanyById',
	        			data : formData
		        	};
		        	req['useToken'] = true;
		        	req['successFn'] = function(respData){
		        		layer.msg(respData.message, {icon: 6},function(){
        					if(respData.code == SUCCESS_CODE){
    						 	var index = parent.layer.getFrameIndex(window.name); //获取窗口索引  
   	                        	parent.layer.close(index);  
        					}
        				}); 
		        	};
		        	ajaxRequest(req);
		        }
		    })
		});
	</script>
</body>
</html>